<template>
    <div>
     <e-chart 
     class="chart" 
     :option="option" />
    </div>
</template>

<script>
import ECharts from 'vue-echarts'
import echarts from 'echarts';
export default {
    name: 'ECharts',
    data() {
        return {
            data: [
                {
                    time: '2018-01-01',
                    value: Math.random() * 100,
                },
                 {
                    time: '2018-01-01',
                    value: Math.random() * 100,
                },
                 {
                    time: '2018-01-01',
                    value: Math.random() * 100,
                },
                 {
                    time: '2018-01-01',
                    value: Math.random() * 100,
                },
            ],
        };
    },
    computed: {
        option() {
            return {
                xAxis: {
                    type: 'category',
                    data: this.data.map(d => d.time),
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                        data: this.data.mp(d => d.value),
                        type: 'line'
                    }
                ],
            };
        },
    },
};
</script>

<style scoped>
.chart {
  height: 400px;
}
</style>